﻿//// Copyright (c) Yoganand R. All rights reserved.
//// For continued development and updates, visit http://yogsbreath.net
//using System;
//using System.Collections.Generic;
//using System.Web.UI.WebControls;
//using System.ComponentModel;
//using System.IO;
//using System.Reflection;
//using System.Collections;
//using System.Web.UI;
//using System.Text;

//namespace MVCnExt.Web.UI.Ext
//{
//    /// <summary>
//    /// This class encapsulates the user interface of an Ext.grid.GridPanel. Methods of this 
//    /// class may be used to access user interface elements to enable special display effects. 
//    /// Do not change the DOM structure of the user interface.
//    ///
//    /// This class does not provide ways to manipulate the underlying data. The data model of a 
//    /// Grid is held in an Ext.data.Store.
//    /// </summary>
//    [Description("This class encapsulates the user interface of an Ext.grid.GridPanel. Methods of this class may be used to access user interface elements to enable special display effects. Do not change the DOM structure of the user interface.This class does not provide ways to manipulate the underlying data. The data model of a Grid is held in an Ext.data.Store.")]
//    public class ExtGridViewPanel : ExtComponent
//    {
//        public override List<ScriptReference> GetScriptReferences()
//        {
//            return base.GetScriptReferences();
//        }

//        public override IList<ScriptDescriptor> GetScriptDescriptors()
//        {
//            IList<ScriptDescriptor> list = base.GetScriptDescriptors();

//            ScriptControlDescriptorBase desc = (ScriptControlDescriptorBase)list[0];

//            desc.Type = "Ext.form.Checkbox";

//            String[] properties = new String[]{
//                "boxLabel", "checked", "fieldLabel", "name"       
//            };

//            Type component = typeof(ExtPanel);

//            foreach (String property in properties)
//            {
//                PropertyInfo i = component.GetProperty(property);

//                if (i == null)
//                    throw new InvalidOperationException(String.Format("Property not found, 'ExtJsPanel.{0}'", property));

//                Object value = i.GetValue(this, null);

//                if (value == null)
//                {
//                    continue;
//                }

//                if (!(value is String))
//                    desc.AddPropertyBase(property, value);
//                else
//                    desc.AddPropertyBase(property, String.Format("'{0}'", value));
//            }

//            return list;
//        }

//        #region Public Properties

//        /// <summary>
//        /// True to auto expand the columns to fit the grid when the grid is created.
//        /// </summary>
//        [Description("True to auto expand the columns to fit the grid when the grid is created.")]
//        public Boolean? autoFill { get; set; }

//        /// <summary>
//        /// The text displayed in the \"Columns\" menu item
//        /// </summary>
//        [Description("The text displayed in the \"Columns\" menu item")]
//        public Boolean columnsText { get; set; }

//        /// <summary>
//        /// The selector used to find cells internally
//        /// </summary>
//        [Description("The selector used to find cells internally")]
//        public String cellSelector { get; set; }

//        /// <summary>
//        /// The number of levels to search for cells in event delegation (defaults to 4)
//        /// </summary>
//        [DefaultValue(4)]
//        [Description("The number of levels to search for cells in event delegation (defaults to 4)")]
//        public Boolean cellSelectorDepth { get; set; }

//        /// <summary>
//        /// True to defer emptyText being applied until the store's first load
//        /// </summary>
//        [DefaultValue(true)]
//        [Description("True to defer emptyText being applied until the store's first load")]
//        public Boolean deferEmptyText { get; set; }

//        /// <summary>
//        /// Default text to display in the grid body when no rows are available (defaults to '').
//        /// </summary>
//        [Description("Default text to display in the grid body when no rows are available (defaults to '').")]
//        public String emptyText { get; set; }

//        /// <summary>
//        /// True to add a second TR element per row that can be used to provide a row body that spans 
//        /// beneath the data row. Use the getRowClass method's rowParams config to customize the row body.
//        /// </summary>
//        [Description("True to add a second TR element per row that can be used to provide a row body that spans beneath the data row. Use the getRowClass method's rowParams config to customize the row body.")]
//        public Boolean? enableRowBody { get; set; }

//        /// <summary>
//        /// True to auto expand/contract the size of the columns to fit the grid width and prevent 
//        /// horizontal scrolling.
//        /// </summary>
//        [Description("True to auto expand/contract the size of the columns to fit the grid width and prevent horizontal scrolling.")]
//        public Boolean? forceFit { get; set; }

//        /// <summary>
//        /// The selector used to find rows internally
//        /// </summary>
//        [Description("The selector used to find rows internally")]
//        public Boolean rowSelector { get; set; }

//        /// <summary>
//        /// The number of levels to search for rows in event delegation (defaults to 10)
//        /// </summary>
//        [DefaultValue(10)]
//        [Description("The number of levels to search for rows in event delegation (defaults to 10)")]
//        public Unit rowSelectorDepth { get; set; }

//        /// <summary>
//        /// The amount of space to reserve for the scrollbar (defaults to 19 pixels)
//        /// </summary>
//        [DefaultValue(19)]
//        [Description("The amount of space to reserve for the scrollbar (defaults to 19 pixels)")]
//        public Boolean scrollOffset { get; set; }

//        /// <summary>
//        /// The text displayed in the \"Sort Ascending\" menu item
//        /// </summary>
//        [Description("The text displayed in the \"Sort Ascending\" menu item")]
//        public Boolean sortAscText { get; set; }

//        /// <summary>
//        /// The text displayed in the \"Sort Descending\" menu item
//        /// </summary>
//        [Description("The text displayed in the \"Sort Descending\" menu item")]
//        public Boolean sortDescText { get; set; }

//        public Boolean autoExpandColumn { get; set; }

//        #endregion
//    }
//}
